export const request = (url, params, method = "GET") => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: "https://api-hmugo23-web.itheima.net/api/public/v1" + url,
			method: method,
			data: params, //传入组装的参数
			success: function(result) {
				
				// 返回数据
				resolve(result);
			},
			fail: function(error) {
				// 返回数据
				console.log("发送请求失败,请检查接口请求路径或参数", error);
				const data = {
					code: "500",
					msg: "发送请求失败,请检查接口请求路径或参数",
					data: {}
				}
				resolve(data)
			}
		})

	})
}